<template>
  <div>
    <RouterLink to="/test">测试</RouterLink>
  </div>
  <div>
    <el-button type="primary" @click="router.push('test')">
      普通跳转
    </el-button>
  </div>
  <div>
    <el-button
        type="primary"
        @click="router.push({path:'test',
        query:{id: data.id, name: data.name, tag: data.tag}})"
    >
      路由传参
    </el-button>
  </div>

  <div>
    <RouterLink to="/test">测试</RouterLink>
    <el-input
        v-model="data.tag"
        placeholder="请输入内容"
        style="width: 240px"
    />
    <p>当前tag值：{{data.tag}}</p>
  </div>
</template>

<script setup>
import { reactive } from "vue";
import { useRouter } from "vue-router";
import { Search, Position, Calendar } from "@element-plus/icons-vue";
import { useDark, useToggle } from '@vueuse/core'
import request from "@/utils/request.js";

const router = useRouter()
const data = reactive({
  id: 2,
  name: "测试",
  tag: ""

})


</script>